草庐IT

flutter - textDirection != null assert is not null ListTile

全部标签

dart - Flutter - TextInputAction 图标没有改变

所以在我的TextFormField小部件中,我将TextInputAction设置为TextInputAction.next,我还定义了focusNodes和onFieldSubmitted回调。文本字段之一:TextFormField(keyboardType:TextInputType.number,maxLength:2,validator:(value)=>value.isEmpty?"BirthMonth":null,onSaved:(value)=>_birthMonth=value,textInputAction:TextInputAction.next,focusNo

dart - Flutter - TextInputAction 图标没有改变

所以在我的TextFormField小部件中,我将TextInputAction设置为TextInputAction.next,我还定义了focusNodes和onFieldSubmitted回调。文本字段之一:TextFormField(keyboardType:TextInputType.number,maxLength:2,validator:(value)=>value.isEmpty?"BirthMonth":null,onSaved:(value)=>_birthMonth=value,textInputAction:TextInputAction.next,focusNo

flutter - StatefulWidget 在导航中被释放

我有一个包含ListView的有状态小部件MyList。在点击任何列表block时,新屏幕(MyScreen)打开,返回后(通过按左上角的后退按钮)滚动位置丢失,因为MyList被处置并且initState再次运行。如何防止MyList被释放?classMyListextendsStatefulWidget{@override_MyListStatecreateState()=>new_MyListState();}class_MyListStateextendsState{Listitems=newList.generate(20,(index)=>'Hello$index');@o

flutter - StatefulWidget 在导航中被释放

我有一个包含ListView的有状态小部件MyList。在点击任何列表block时,新屏幕(MyScreen)打开,返回后(通过按左上角的后退按钮)滚动位置丢失,因为MyList被处置并且initState再次运行。如何防止MyList被释放?classMyListextendsStatefulWidget{@override_MyListStatecreateState()=>new_MyListState();}class_MyListStateextendsState{Listitems=newList.generate(20,(index)=>'Hello$index');@o

flutter - 如何将小部件/文本添加到容器的边框?

我想在容器的边框上添加一些文本,以作为容器内容的帮助文本。我是Flutter的新手,有人可以帮忙吗。 最佳答案 没有任何直接的方法可以做到这一点。你必须使用Stack和Positioned小部件实现。这里我演示了如何使用。import'package:flutter/material.dart';voidmain()=>runApp(MyApp());classMyAppextendsStatefulWidget{@override_MyAppStatecreateState()=>_MyAppState();}class_MyAp

flutter - 如何将小部件/文本添加到容器的边框?

我想在容器的边框上添加一些文本,以作为容器内容的帮助文本。我是Flutter的新手,有人可以帮忙吗。 最佳答案 没有任何直接的方法可以做到这一点。你必须使用Stack和Positioned小部件实现。这里我演示了如何使用。import'package:flutter/material.dart';voidmain()=>runApp(MyApp());classMyAppextendsStatefulWidget{@override_MyAppStatecreateState()=>_MyAppState();}class_MyAp

dart - OpenFlutter/flutter_oktoast 只显示在主页上?

我正在使用this在我的应用程序中显示自定义toast的库。我的应用程序中有多个页面。问题是,即使我从任何其他页面调用showToastWidget(...),toast也会出现在主页上。主页@overrideWidgetbuild(BuildContextcontext){returnOKToast(child:Scaffold(backgroundColor:Theme.of(context).accentColor,body:Center(child:SizedBox(height:50,width:50,child:Image(image:AssetImage('assets/

dart - OpenFlutter/flutter_oktoast 只显示在主页上?

我正在使用this在我的应用程序中显示自定义toast的库。我的应用程序中有多个页面。问题是,即使我从任何其他页面调用showToastWidget(...),toast也会出现在主页上。主页@overrideWidgetbuild(BuildContextcontext){returnOKToast(child:Scaffold(backgroundColor:Theme.of(context).accentColor,body:Center(child:SizedBox(height:50,width:50,child:Image(image:AssetImage('assets/

Flutter GestureDetector 根本不工作

我正在尝试使用GestureDetector使文本小部件可缩放,但它根本不起作用,我什至没有收到任何错误...请注意,我尝试了很多事情,比如用GestureDetector包裹脚手架本身......ma​​in.dartimport'package:flutter/material.dart';import'package:testy/zoomable.dart';voidmain()=>runApp(MaterialApp(debugShowCheckedModeBanner:false,title:'Testy',theme:ThemeData(primarySwatch:Colo

Flutter GestureDetector 根本不工作

我正在尝试使用GestureDetector使文本小部件可缩放,但它根本不起作用,我什至没有收到任何错误...请注意,我尝试了很多事情,比如用GestureDetector包裹脚手架本身......ma​​in.dartimport'package:flutter/material.dart';import'package:testy/zoomable.dart';voidmain()=>runApp(MaterialApp(debugShowCheckedModeBanner:false,title:'Testy',theme:ThemeData(primarySwatch:Colo